package com.apes.autoparts.searcher.model;


import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = EpcAnalysisReport.CONST_TABLE_NAME)
public class EpcAnalysisReport {
    public static final String CONST_TABLE_NAME = "EPC_ANALYSIS_RPT";

    @Id
    @Column(name = "rowid")
    @ApesGenerator(code = CONST_TABLE_NAME, name = "编号字段")
    private String rowid;  //配件编码

    @Column(name = "MY_MODEL_STD_ID", nullable = false, length = 128)
    @Comment("EPC编码")
    private String epcId;

    @Column(name = "EPC_BBMC", nullable = false, length = 128)
    @Comment("EPC版本")
    private String epcVersion;

    @Column(name = "PARSE_RATE_SINGLE", nullable = false, length = 4000)
    @Comment("单车型编译率")
    private String parseRateSingle;

    @Column(name = "PARSE_RATE_TOTAL", nullable = false, length = 4000)
    @Comment("全车型编译率")
    private String parseRateTotal;

    @Column(name = "PARSE_NAME_NUM", nullable = false)
    @Comment("单车型目录名称数量")
    private int parseNameNum;

    @Column(name = "PARSE_TOTAL_RATE", nullable = false, length = 4000)
    @Comment("单车型目录 + 配件清单占比")
    private String parseTotalRate;

    @Column(name = "COVER_CAR_NUM", nullable = false)
    @Comment("单车型覆盖erp车型数量")
    private int coverCarNum;

    @Column(name = "COVER_VIP_NUM", nullable = false)
    @Comment("单车型覆盖erp会员保有量")
    private int coverVipNum;

    @Column(name = "INSERT_TIME", nullable = false)
    @Comment("写入时间")
    private int insertTime;
}
